

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Testing Anaconda &mdash; Anaconda 25.14 documentation</title>
  

  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
    <link rel="top" title="Anaconda 25.14 documentation" href="index.html"/>
        <link rel="next" title="tests" href="tests/modules.html"/>
        <link rel="prev" title="pyanaconda.ui.tui.spokes package" href="pyanaconda.ui.tui.spokes.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> Anaconda
          

          
          </a>

          
            
            
              <div class="version">
                25.14
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
                <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to Anaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="release.html">Building a Release</a></li>
<li class="toctree-l1"><a class="reference internal" href="boot-options.html">Anaconda Boot Options</a></li>
<li class="toctree-l1"><a class="reference internal" href="kickstart.html">Anaconda Kickstart Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="commit-log.html">Rules for commit messages</a></li>
<li class="toctree-l1"><a class="reference internal" href="driverdisc.html">Brief description of DriverDisc version 3</a></li>
<li class="toctree-l1"><a class="reference internal" href="iscsi.html">iSCSI and Anaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="multipath.html">Multipath and Anaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pyanaconda</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Testing</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#test-suite-architecture">Test Suite Architecture</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tests/modules.html">tests</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="index.html">Anaconda</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          





<div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="index.html">Docs</a> &raquo;</li>
      
    <li>Testing Anaconda</li>
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="_sources/testing.txt" rel="nofollow"> View page source</a>
          
        
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="testing-anaconda">
<h1>Testing Anaconda<a class="headerlink" href="#testing-anaconda" title="Permalink to this headline">¶</a></h1>
<p>Before testing Anaconda you need to install all required dependencies,
prepare the environment and build the sources:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>make -f Makefile.am install-test-requires
./autogen.sh
./configure
make
</pre></div>
</div>
<p>Executing the tests can be done with:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>make check
</pre></div>
</div>
<p>To run a single test do:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>make TESTS=install/run_install_test.sh check
</pre></div>
</div>
<p>See <cite>tests/Makefile.am</cite> for possible values. Alternatively you can try:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>make ci
</pre></div>
</div>
<p>This has the advantage of producing Python test coverage for all tests.
In case the <em>ci</em> target fails there is also a <em>coverage-report</em> target
which can be used to combine the multiple <cite>.coverage</cite> files into one and
produce a human readable report.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>When using the <a href="#id1"><span class="problematic" id="id2">`</span></a>ci&#8217; target you need to use a regular user account which
is a member of the <a href="#id3"><span class="problematic" id="id4">`</span></a>mock&#8217; group. You can update your account by running
the command:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># usermod -a -G mock &lt;username&gt;</span>
</pre></div>
</div>
<p class="last">Your regular user account also needs to execute <a href="#id5"><span class="problematic" id="id6">`</span></a>sudo&#8217; because some tests
require root privileges!</p>
</div>
<div class="section" id="test-suite-architecture">
<h2>Test Suite Architecture<a class="headerlink" href="#test-suite-architecture" title="Permalink to this headline">¶</a></h2>
<p>Anaconda has a complex test suite structure where each top-level directory
represents a different class of tests. They are</p>
<ul class="simple">
<li><em>cppcheck/</em> - static C/C++ code analysis using the <em>cppcheck</em> tool;</li>
<li><em>dd_tests/</em> - Python unit tests for driver disk utilities (utils/dd);</li>
<li><em>dracut_tests/</em> - Python unit tests for the dracut hooks used to configure the
installation environment and load Anaconda;</li>
<li><em>gettext/</em> - sanity tests of files used for translation; Written in Python and
Bash;</li>
<li><em>glade/</em> - sanity tests for .glade files. Written in Python;</li>
<li><em>gui/</em> - specialized test suite for the graphical interface of anaconda. This
is written in Python and uses the <a class="reference external" href="https://fedorahosted.org/dogtail/">dogtail</a>
accessibility module. All tests are executed using ./anaconda.py from the local
directory;</li>
<li><em>install/</em> - basic RPM sanity test. Checks if anaconda.rpm can be installed in
a temporary directory without failing dependencies or other RPM issues;</li>
<li><em>lib/</em> - helper modules used during testing;</li>
<li><em>pyanaconda_tests/</em> - unit tests for the <a class="reference internal" href="pyanaconda.html#module-pyanaconda" title="pyanaconda"><code class="xref py py-mod docutils literal"><span class="pre">pyanaconda</span></code></a> module;</li>
<li><em>pylint/</em> - checks the validity of Python source code using the <em>pocketlint</em>
tool;</li>
<li><em>regex_tests/</em> - Python unit tests for regular expressions defined in
<a class="reference internal" href="pyanaconda.html#module-pyanaconda.regexes" title="pyanaconda.regexes"><code class="xref py py-mod docutils literal"><span class="pre">pyanaconda.regexes</span></code></a>;</li>
<li><em>storage/</em> - test cases used to verify partitioning scenarios for success or
expected failures. The scenarios are described using kickstart snippets.
Written in Python with a custom test case framework based on
<a class="reference external" href="https://github.com/rhinstaller/blivet">blivet</a>;</li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>All Python unit tests inherit from the standard <a class="reference external" href="https://docs.python.org/3/library/unittest.html#unittest.TestCase" title="(in Python v3.5)"><code class="xref py py-class docutils literal"><span class="pre">unittest.TestCase</span></code></a>
class unless specified otherwise!</p>
<p class="last">Some tests require root privileges and will be skipped if running as regular
user!</p>
</div>
</div>
</div>


           </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="tests/modules.html" class="btn btn-neutral float-right" title="tests" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="pyanaconda.ui.tui.spokes.html" class="btn btn-neutral" title="pyanaconda.ui.tui.spokes package" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2015, Red Hat, Inc..

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'25.14',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>